<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 
        1. type=file  选择文件 
        2. accept ==> 引导我们选择什么文件，接收的是image
     -->
    <input type="file" name="avatar" accept="image/*" multiple placeholder="请选择头像">
    <script>
    //   document.querySelector('input').onchange = function(e){
    //     console.log('文件信息', e.target.files[0])
    //   }

      const ipt = document.querySelector('input')
      ipt.addEventListener('change', function(e){
        // console.log('文件信息', )
        console.log(e)
        // console.log(e.target.files[0])
      })
    </script>
</body>
</html>